// Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.kpdus.com/jad.html
// Decompiler options: packimports(3) 

package com.nnee.p_img.p_video;

import android.content.Context;
import android.content.res.AssetManager;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.net.Uri;
import android.os.ParcelFileDescriptor;
import android.text.TextUtils;
import android.webkit.URLUtil;
import com.nnee.p_img.cls_c;
import com.nnee.p_pr.p_app.cls_PrisApp;
import java.io.*;

// Referenced classes of package com.nnee.p_img.p_video:
//            a, al, u

public class cls_ac
    implements cls_a
{

    public cls_ac(cls_u u, Uri uri, String s)
    {
        l = -1;
        m = -1;
        j = uri;
        k = u;
        n = s;
    }

    static Bitmap a(Context context, String s)
    {
        Bitmap bitmap = null;
        if(context != null && !TextUtils.isEmpty(s)) {
        	AssetManager assetmanager = context.getAssets();
            try
            {
                InputStream inputstream = assetmanager.open(s);
                bitmap = BitmapFactory.decodeStream(inputstream);
                if(inputstream != null)
                    inputstream.close();
            }
            catch(IOException ioexception)
            {
                ioexception.printStackTrace();
            }
        }
 
        return bitmap;
 
    }

    private void h()
    {
        ParcelFileDescriptor parcelfiledescriptor = null;
        ParcelFileDescriptor parcelfiledescriptor2=null;
		try {
			parcelfiledescriptor2 = ParcelFileDescriptor.open(new File(j.getPath()), 0x10000000);
		} catch (FileNotFoundException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
        parcelfiledescriptor = parcelfiledescriptor2;
        android.graphics.BitmapFactory.Options options = new android.graphics.BitmapFactory.Options();
        options.inJustDecodeBounds = true;
        a(parcelfiledescriptor.getFileDescriptor(), options);
        l = options.outWidth;
        m = options.outHeight;
        cls_al.a(parcelfiledescriptor);
 
        return;
//        FileNotFoundException filenotfoundexception;
//        filenotfoundexception;
//        l = 0;
//        m = 0;
//        al.a(parcelfiledescriptor);
//        if(true) goto _L2; else goto _L1
//_L1:
//        Exception exception;
//        exception;
//        ParcelFileDescriptor parcelfiledescriptor1;
//        Exception exception1;
//        parcelfiledescriptor1 = parcelfiledescriptor;
//        exception1 = exception;
//_L4:
//        al.a(parcelfiledescriptor1);
//        throw exception1;
//        Exception exception2;
//        exception2;
//        parcelfiledescriptor1 = parcelfiledescriptor;
//        exception1 = exception2;
//        if(true) goto _L4; else goto _L3
//_L3:
    }

    public Bitmap a(int i, int i1)
    {
        return com.nnee.p_img.cls_c.c(f(), i, i1);
    }

    public Bitmap a(FileDescriptor filedescriptor, android.graphics.BitmapFactory.Options options)
    {
        Bitmap bitmap = null;
        if(!options.mCancel)
            bitmap = BitmapFactory.decodeFileDescriptor(filedescriptor, null, options);
        return bitmap;
    }

    public cls_u a()
    {
        return k;
    }

    public Uri b()
    {
        return j;
    }

    public String c()
    {
        return j.getPath();
    }

    public int d()
    {
        if(l == -1)
            h();
        return l;
    }

    public int e()
    {
        if(m == -1)
            h();
        return m;
    }

    public boolean equals(Object obj)
    {
        boolean flag;
        if(obj == null || !(obj instanceof cls_ac))
            flag = false;
        else
            flag = j.equals(((cls_ac)obj).j);
        return flag;
    }

    public Bitmap f()
    {
        Bitmap bitmap;
        if(URLUtil.isAssetUrl(j.toString()))
        {
            String s = j.toString().substring("file:///android_asset/".length());
            bitmap = a(cls_PrisApp.a(), s);
        } else
        {
            bitmap = BitmapFactory.decodeFile(j.getPath());
        }
        return bitmap;
    }

    public CharSequence g()
    {
        return n;
    }

    public int hashCode()
    {
        return j.hashCode();
    }

    private static final int o = -1;
    Uri j;
    cls_u k;
    int l;
    int m;
    CharSequence n;
}
